﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WCFGPSTrackingApp
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "WCFServiceApp" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select WCFServiceApp.svc or WCFServiceApp.svc.cs at the Solution Explorer and start debugging.
    public class WCFServiceApp : IWCFServiceApp
    {
        public Entities.Users GetUser(string Username)
        {
            GPSTrackingDBV2.Entities.Users UserEntity = GPSTrackingDBV2.Data.DataRepository.UsersProvider.GetByUsername(Username);

            Entities.Users UserEntityReturn = new Entities.Users();

            if (UserEntity != null)
            {
                UserEntityReturn.Username = UserEntity.Username;
                UserEntityReturn.Password = UserEntity.Password;
            }

            return UserEntityReturn;
        }

        public string GetDate()
        {
            return DateTime.Now.ToShortDateString();
        }
    }
}
